package com.tater.springboot.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tater.springboot.dao.ArticleMapper;
import com.tater.springboot.model.Article;
import com.tater.springboot.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ---------------------------
 * 文章表 (ArticleServiceImpl)
 * ---------------------------
 */
@Service
public class ArticleServiceImpl implements ArticleService {

	@Autowired
	private ArticleMapper articleMapper;


	@Override
	public PageInfo articleList(Integer pageNo) {
		PageHelper.startPage(pageNo,2);
		List<Article> page = articleMapper.findPage();
		PageInfo<Article> pageInfo = new PageInfo<>(page);
		return pageInfo;
	}
}
